:- dynamic odd/1, even/1.  

/*
*	O
*/
:- multifile option/2.


%Maximum number of body literals
option(max_body_literals, 2).
option(score_before_condition, false).
%Maximum number of rules
option(max_num_rules, 2).
option(single_seed, false).
option(strategy, full_breadth).
option(max_depth, 200).
/*
*	B
*/


%even(0).

%odd(X) :- X = s(Y), even(Y).


 
/*
*	M
*/


modeh(odd(+nat), [name(oh)]).
modeh(even(+nat), [name(eh)]).

even(0).

modeb(\+ odd(+nat), [name(nob)]).
modeb(even(+nat), [name(eb)]).
modeb(=(+nat, s(-nat))).




/*
*	E
*/

%ic :-  pr(1,[(oh,[],[]),(ob,[],[(1,1)])]).
%ic :-  pr(1,[(oh,[],[]),(eb,[],[(1,1)])]).
%ic :-  pr(1,[(eh,[],[]),(ob,[],[(1,1)])]).
%ic :-  pr(1,[(eh,[],[]),(eb,[],[(1,1)])]).
%ic :-  pr(2,[(eh,[],[])]).
%ic :-  pr(2,[(eh,[],[]),(1,[],[(1,1)]), (ob,[],[(1,1)])]).
%ic :-  pr(2,[(eh,[],[]),(1,[],[(1,1)]), (eb,[],[(1,2)])]).
%ic :-  pr(2,[(eh,[],[]),(1,[],[(1,1)]), (eb,[],[(1,1)])]).
%ic :-  pr(2,[(eh,[],[]),(1,[],[(1,1)]), (1,[],[(1,2)])]).
%ic :-  pr(2,[(eh,[],[]),(1,[],[(1,1)])]).
%ic :-  pr(2,[(oh,[],[])]).
%ic :-  pr(2,[(oh,[],[]),(1,[],[(1,1)]), (eb,[],[(1,1)])]).
%ic :-  pr(2,[(oh,[],[]),(1,[],[(1,1)]), (ob,[],[(1,2)])]).
%%ic :-  pr(2,[(oh,[],[]),(1,[],[(1,1)]), (ob,[],[(1,1)])]).
%ic :-  pr(2,[(oh,[],[]),(1,[],[(1,1)]), (1,[],[(1,2)])]).
%ic :-  pr(2,[(oh,[],[]),(1,[],[(1,1)])]).


ic :- pr(_, R), member((eb,[],[(1,1)]), R).
ic :- pr(_, R), member((ob,[],[(1,1)]), R), member((oh,[],[]), R).


%example(odd(s(s(s(0)))), 1).
example(odd(s(s(s(0)))), 1).
%example(odd(s(0)), 1).
%example(even(s(s(0))), 1).
%example(even(0), 1).
%example(even(s(s(s(s(s(s(0))))))), 1).
%example(odd(s(0)), 1).
example(odd(s(s(0))), -1).
%example(odd(s(s(s(s(0))))), -1).
%example(odd(0), -1).
